<template>
	<view class="news">
		<view class="news1">
			<view class="img">
				<image src="/static/news/news1.png"></image>
			</view>
			<view class="contentX" @tap="announcement">
				<view class="left">
					<text>公告消息</text>
					<text class="is_show" v-if="messageShow1 == 1"></text>
				</view>
				<!-- <view class="right">2020-10-9 9:15</view> -->
			</view>
		</view>
		<view class="news2">
			<view class="img">
				<image src="/static/news/news2.png"></image>
			</view>
			<view class="contentX" @tap="notice">
				<view class="left">
					<text>通知消息</text>
					<text class="is_show" v-if="messageShow2 == 1"></text>
				</view>
				<!-- <view class="right">2020-10-9 9:15</view> -->
			</view>
		</view>
		<view class="line"></view>
		<view class="news3" @tap="customerService">
			<view class="img">
				<image src="/static/news/news3.png"></image>
			</view>
			<view class="contentX">
				<view class="left">
					<text>学管消息</text>
					<!-- <text class="is_show"></text> -->
				</view>
				<!-- <view class="right">2020-10-9 9:15</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				messageShow1: '',
				messageShow2: ''
			}
		},
		onLoad() {
			// console.log(this.letterList)
		},
		onShow() {
			this.messageInfo()
		},
		
		methods: {
			messageInfo() {
				this.$api.post(global.apiUrls.postMessageShow, {
					
					
				}).then(res => {
					console.log(res)
					if(res.data.code == 1) {
						this.messageShow1 = res.data.data[1]
						this.messageShow2 = res.data.data[4]
					} else {
						this.$message.info(res.data.msg)
					}
				})
			},
			// 跳转公告消息
			announcement() {
				uni.navigateTo({
					url: '/pages/home/news/message1'
				})
			},
			// 通知消息
			notice() {
				uni.navigateTo({
					url:'/pages/home/news/message2'
					
				})
			},
			// 客服消息
			customerService() {
				uni.navigateTo({
					url: '/pages/my/customer/customer'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>

	page {
		background: #F8F8F8;
		color: #333333;
		font-size: 32rpx;
	}

	.news {
		.news1 {
			padding: 0 32rpx;
			display: flex;
			background: #FFFFFF;
			.img {
				width: 90rpx;
				height: 90rpx;
				// margin-right: 24rpx;
				// margin-left: 32rpx;
				margin: 32rpx 24rpx 32rpx 0;
				image {
					width: 90rpx;
					height: 90rpx;
					
				}
			}
			.contentX {
				padding: 32rpx 0;
				width: calc(100% - 90rpx);
				border-bottom: 1rpx solid #EEEEEE;
				display: flex;
				vertical-align: middle;
				line-height: 88rpx;
				.left {
					width: 50%;
					text:first-child {
						font-size: 28rpx;
						margin-right: 17rpx;
					}
					.is_show {
						display: inline-block;
						width: 16rpx;
						height: 16rpx;
						background: #FF5656;
						border-radius: 50%;
						transform: translateY(-2rpx);
					}
				}
				.right {
					width: 50%;
					font-size: 24rpx;
					color: #999999;
					text-align: right;
					padding-right: 32rpx;
				}
			}
		}
		.news2 {
			padding: 0 32rpx;
			display: flex;
			background: #FFFFFF;
			.img {
				width: 90rpx;
				height: 90rpx;
				// margin-right: 24rpx;
				// margin-left: 32rpx;
				margin: 32rpx 24rpx 32rpx 0;
				image {
					width: 90rpx;
					height: 90rpx;
					
				}
			}
			.contentX {
				padding: 32rpx 0;
				width: calc(100% - 90rpx);
				border-bottom: 1rpx solid #EEEEEE;
				display: flex;
				vertical-align: middle;
				line-height: 88rpx;
				.left {
					width: 50%;
					text:first-child {
						font-size: 28rpx;
						margin-right: 17rpx;
					}
					.is_show {
						display: inline-block;
						width: 16rpx;
						height: 16rpx;
						background: #FF5656;
						border-radius: 50%;
						transform: translateY(-2rpx);
					}
				}
				.right {
					width: 50%;
					font-size: 24rpx;
					color: #999999;
					text-align: right;
					padding-right: 32rpx;
				}
			}
		}
		.news3 {
			// padding: 32rpx 0;
			display: flex;
			background: #FFFFFF;
			.img {
				width: 90rpx;
				height: 90rpx;
				// margin-right: 24rpx;
				// margin-left: 32rpx;
				margin: 32rpx 24rpx 32rpx 32rpx;
				image {
					width: 90rpx;
					height: 90rpx;
					
				}
			}
			.contentX {
				padding: 32rpx 0;
				width: calc(100% - 90rpx);
				border-bottom: 1rpx solid #FFFFFF;
				display: flex;
				vertical-align: middle;
				line-height: 88rpx;
				.left {
					width: 50%;
					text:first-child {
						font-size: 28rpx;
						margin-right: 17rpx;
					}
					.is_show {
						display: inline-block;
						width: 16rpx;
						height: 16rpx;
						background: #FF5656;
						border-radius: 50%;
						transform: translateY(-2rpx);
					}
				}
				.right {
					width: 50%;
					font-size: 24rpx;
					color: #999999;
					text-align: right;
					padding-right: 32rpx;
				}
			}
		}
		.line {
			height: 20rpx;
			width: 100%;
		}
	}
</style>
